package chapter3;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class ToggleButtons {
	
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		
		Button button = new Button(shell, SWT.TOGGLE);
		button.setText("toggle button");
		
		Button button1 = new Button(shell, SWT.TOGGLE);
		button1.setText("toggle button2");

		shell.setSize(240, 100);
		button.setBounds(10, 10, 100, 30);
		button1.setBounds(110, 10, 100, 30);

		
		shell.setVisible(true);
		shell.setFocus();
		
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}
}
